package net.siufung.simple.demo.service;

import lombok.extern.slf4j.Slf4j;
import net.siufung.boot.executor.ExecutorConstants;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

import java.util.concurrent.CompletableFuture;

/**
 * @author 陈建峰
 * @date 2022/9/26 5:40 下午
 * @since V1.0.0
 */
@Slf4j
@Service
public class DemoAsyncService {

    @Async(ExecutorConstants.THREAD_POOL_TASK_EXECUTOR)
    public CompletableFuture<String> demo(){
        log.info("demoAsyncService");
        return CompletableFuture.completedFuture("demo");
    }
}
